package fina2.dcs.fis;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.jboss.seam.annotations.Name;

@Entity
@SuppressWarnings("serial")
@Name("banks")
@Table(name = "IN_BANKS")
public class Bank implements Serializable {
	private BigDecimal id;
	private String code;
	private BigDecimal typeId;
	private BigDecimal shortNameStrId;
	private BigDecimal namestrid;
	private BigDecimal addressStrId;
	private String phone;
	private String fax;
	private String email;
	private String telex;
	private String swiftCode;
	private String name;

	private BankType bankType;
	private List<BankGroup> bankGroups;
	private List<LicenceType> licenceTypes;
	private List<BankBranch> bankBranches;
	private List<BankManagement> bankMan;
	
	private String shortName;
    private String address;
    
	@Id
	@Column(name = "ID")
	public BigDecimal getId() {
		return id;
	}

	public void setId(BigDecimal id) {
		this.id = id;
	}

	@Column(name = "TYPEID")
	public BigDecimal getTypeId() {
		return typeId;
	}

	public void setTypeId(BigDecimal typeId) {
		this.typeId = typeId;
	}

	@Column(name = "SHORTNAMESTRID")
	public BigDecimal getShortNameStrId() {
		return shortNameStrId;
	}

	public void setShortNameStrId(BigDecimal shortNameStrId) {
		this.shortNameStrId = shortNameStrId;
	}

	@Column(name = "NAMESTRID")
	public BigDecimal getNamestrid() {
		return namestrid;
	}

	public void setNamestrid(BigDecimal namestrid) {
		this.namestrid = namestrid;
	}

	@Column(name = "ADDRESSSTRID")
	public BigDecimal getAddressStrId() {
		return addressStrId;
	}

	public void setAddressStrId(BigDecimal addressStrId) {
		this.addressStrId = addressStrId;
	}

	@Column(name = "CODE")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "PHONE")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "FAX")
	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	@Column(name = "EMAIL")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "TELEX")
	public String getTelex() {
		return telex;
	}

	public void setTelex(String telex) {
		this.telex = telex;
	}

	@Column(name = "SWIFTCODE")
	public String getSwiftCode() {
		return swiftCode;
	}

	public void setSwiftCode(String swiftCode) {
		this.swiftCode = swiftCode;
	}

	public String toString() {
		return code;
	}

	@Transient
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name=name;
	}

	@Transient
	public List<BankGroup> getBankGroups() {
		return bankGroups;
	}

	public void setBankGroups(List<BankGroup> bankGroups) {
		this.bankGroups = bankGroups;
	}

	@Transient
	public List<LicenceType> getLicenceTypes() {
		return licenceTypes;
	}

	public void setLicenceTypes(List<LicenceType> licenceTypes) {
		this.licenceTypes = licenceTypes;
	}

	
	@Transient
	public BankType getBankType() {
		return bankType;
	}

	public void setBankType(BankType bankType) {
		this.bankType = bankType;
	}

	
	@Transient
	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	
	@Transient
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	
	@Transient
	public List<BankBranch> getBankBranches() {
		return bankBranches;
	}

	public void setBankBranches(List<BankBranch> bankBranches) {
		this.bankBranches = bankBranches;
	}

	
	@Transient
	public List<BankManagement> getBankMan() {
		return bankMan;
	}

	public void setBankMan(List<BankManagement> bankMan) {
		this.bankMan = bankMan;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Bank other = (Bank) obj;
		if (code == null) {
			if (other.code != null)
				return false;
		} else if (!code.equals(other.code))
			return false;
		return true;
	}

	
}
